package com.cstp.entity;


import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.cstp.web.req.QuestionOptionReq;
import lombok.Data;
import org.springframework.beans.BeanUtils;

/**
 * @author watts
 */
@Data
@TableName("t_question_option")
public class QuestionOption {

    @TableId(type = IdType.AUTO)
    private Long id;

    private Long questionId;

    private String title;

    private int isAnswer;

    public static QuestionOption of(QuestionOptionReq req) {
        QuestionOption questionOption = new QuestionOption();
        BeanUtils.copyProperties(req, questionOption);
        return questionOption;
    }
}
